package com.heima.feign.clients;

import com.heima.feign.clients.fallback.UserClientFallbackFactory;
import com.heima.feign.config.HeimaFeignAutoConfiguration;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.pojos.ApUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

@FeignClient(value = "leadnews-user", fallbackFactory = UserClientFallbackFactory.class, configuration = HeimaFeignAutoConfiguration.class)
public interface UserClient {

    @PostMapping("api/v1/user/{id}")
    public ResponseResult<ApUser> findUserById(@PathVariable(value = "id") Integer id);
}
